package com.ss.android.common.ui.view;

import android.content.Context;
import android.content.res.TypedArray;
import android.util.AttributeSet;
import android.view.View;
import android.widget.LinearLayout;
import com.ss.android.common.dd;

public class MaxSizeLinearLayout extends LinearLayout {
    private int a;
    private int b;

    public MaxSizeLinearLayout(Context arg2) {
        super(arg2);
        this.a = 0;
        this.b = 0;
    }

    public MaxSizeLinearLayout(Context arg4, AttributeSet arg5) {
        super(arg4, arg5);
        this.a = 0;
        this.b = 0;
        TypedArray v0 = arg4.obtainStyledAttributes(arg5, dd.c, 0, 0);
        this.a = v0.getDimensionPixelSize(dd.e, 0);
        this.b = v0.getDimensionPixelSize(dd.d, 0);
        v0.recycle();
    }

    protected void onMeasure(int arg4, int arg5) {
        int v0 = View.MeasureSpec.getSize(arg4);
        int v1 = View.MeasureSpec.getSize(arg5);
        if(this.a > 0 && this.a < v0) {
            arg4 = View.MeasureSpec.makeMeasureSpec(this.a, View.MeasureSpec.getMode(arg4));
        }

        if(this.b > 0 && this.b < v1) {
            arg5 = View.MeasureSpec.makeMeasureSpec(this.b, View.MeasureSpec.getMode(arg5));
        }

        super.onMeasure(arg4, arg5);
    }
}

